From 35122a7500cd965f8e99d5fd9faae9b0732b55c1 Mon Sep 17 00:00:00 2001 From: Wookey Date: Fri, 16 Nov 2012 08:06:19 -0800 Subject: [PATCH 1/5] configure: respect $CC environment var override Enables e.g. cross-compiling by setting $CC env var. This patch extracted from the Ubuntu package (thanks, Wookey and Colin Watson). BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=670660 BugLink: https://bugs.launchpad.net/bugs/870197 Signed-off-by: Kamal Mostafa --- configure | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 0bfedf9d..99121144 100755 --- a/configure +++ b/configure @@ -3,6 +3,7 @@ # INCLUDE=${1:-"$PWD/include"} : ${PKG_CONFIG:=pkg-config} +: ${CC=gcc} echo "PKG_CONFIG:=${PKG_CONFIG}" >>Config # Make a temp directory in build tree. @@ -19,7 +20,7 @@ int main(int argc, char **argv) { return 0; } EOF -gcc -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1 +$CC -I$INCLUDE -o $TMPDIR/atmtest $TMPDIR/atmtest.c -latm >/dev/null 2>&1 if [ $? -eq 0 ] then echo "TC_CONFIG_ATM:=y" >>Config @@ -53,7 +54,7 @@ int main(int argc, char **argv) EOF -if gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1 +if $CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL $(${PKG_CONFIG} xtables --cflags --libs) -ldl >/dev/null 2>&1 then echo "TC_CONFIG_XT:=y" >>Config echo "using xtables" @@ -90,7 +91,7 @@ int main(int argc, char **argv) { } EOF -gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 +$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 if [ $? -eq 0 ] then @@ -130,7 +131,7 @@ int main(int argc, char **argv) { } EOF -gcc -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 +$CC -I$INCLUDE $IPTC -o $TMPDIR/ipttest $TMPDIR/ipttest.c $IPTL -ldl >/dev/null 2>&1 if [ $? -eq 0 ] then @@ -180,7 +181,7 @@ int main(int argc, char **argv) return 0; } EOF -gcc -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1 +$CC -I$INCLUDE -o $TMPDIR/setnstest $TMPDIR/setnstest.c >/dev/null 2>&1 if [ $? -eq 0 ] then echo "IP_CONFIG_SETNS:=y" >>Config @@ -212,7 +213,7 @@ int main(void) #endif EOF -if gcc -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1 +if $CC -I$INCLUDE -o $TMPDIR/ipsettest $TMPDIR/ipsettest.c >/dev/null 2>&1 then echo "TC_CONFIG_IPSET:=y" >>Config echo "yes" From d0c8420c09de37b91fa50b0772d3d3359d828d23 Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Wed, 14 Nov 2012 16:29:24 +0100 Subject: [PATCH 2/5] ip/ip6tunnel: fix help for TCLASS Help is "[tclass TCLASS]", but only TOS was described. Signed-off-by: Nicolas Dichtel --- ip/ip6tunnel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c index c9720eb2..b23377a6 100644 --- a/ip/ip6tunnel.c +++ b/ip/ip6tunnel.c @@ -60,7 +60,7 @@ static void usage(void) IPV6_DEFAULT_TNL_ENCAP_LIMIT); fprintf(stderr, " TTL := 0..255 (default=%d)\n", DEFAULT_TNL_HOP_LIMIT); - fprintf(stderr, " TOS := { 0x0..0xff | inherit }\n"); + fprintf(stderr, " TCLASS := { 0x0..0xff | inherit }\n"); fprintf(stderr, " FLOWLABEL := { 0x0..0xfffff | inherit }\n"); exit(-1); } From 3f83dce5737bf960e485ea6c8e968b7a7c0c15fd Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Wed, 14 Nov 2012 16:29:25 +0100 Subject: [PATCH 3/5] ip/ip6tunnel: reset encap limit flag on change Flag IP6_TNL_F_IGN_ENCAP_LIMIT is set when encaplimit is none, but it was not removed if encaplimit was set on update (ip tunnel change). Signed-off-by: Nicolas Dichtel --- ip/ip6tunnel.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c index b23377a6..7aaac61b 100644 --- a/ip/ip6tunnel.c +++ b/ip/ip6tunnel.c @@ -157,6 +157,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm *p) if (get_u8(&uval, *argv, 0) < -1) invarg("invalid ELIM", *argv); p->encap_limit = uval; + p->flags &= ~IP6_TNL_F_IGN_ENCAP_LIMIT; } } else if (strcmp(*argv, "hoplimit") == 0 || strcmp(*argv, "ttl") == 0 || From df5574d0667813710ca8e790de84e071df55e54f Mon Sep 17 00:00:00 2001 From: Nicolas Dichtel Date: Wed, 14 Nov 2012 16:29:26 +0100 Subject: [PATCH 4/5] ip/ip6tunnel: fix update of tclass and flowlabel When tclass or flowlabel field were updated, we only performed an OR with the new value. For example, it was not possible to reset tclass: ip -6 tunnel change ip6tnl2 tclass 0 Signed-off-by: Nicolas Dichtel --- ip/ip6tunnel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ip/ip6tunnel.c b/ip/ip6tunnel.c index 7aaac61b..fcc9f33c 100644 --- a/ip/ip6tunnel.c +++ b/ip/ip6tunnel.c @@ -173,6 +173,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm *p) matches(*argv, "dsfield") == 0) { __u8 uval; NEXT_ARG(); + p->flowinfo &= ~IP6_FLOWINFO_TCLASS; if (strcmp(*argv, "inherit") == 0) p->flags |= IP6_TNL_F_USE_ORIG_TCLASS; else { @@ -185,6 +186,7 @@ static int parse_args(int argc, char **argv, int cmd, struct ip6_tnl_parm *p) strcmp(*argv, "fl") == 0) { __u32 uval; NEXT_ARG(); + p->flowinfo &= ~IP6_FLOWINFO_FLOWLABEL; if (strcmp(*argv, "inherit") == 0) p->flags |= IP6_TNL_F_USE_ORIG_FLOWLABEL; else { From 8f2550ab5dd03cb999c517abb0622769f0b2c59c Mon Sep 17 00:00:00 2001 From: Rostislav Lisovy Date: Thu, 22 Nov 2012 09:53:44 +0000 Subject: [PATCH 5/5] tc: add canid ematch to ematch_map The canid ematch has been added in commit: 7b5f30e Ematch used to classify CAN frames according to their identifiers But the corresponding entry in etc/iproute2/ematch_map was lost. This patch adds the missing entry in ematch_map, otherweise tc would complain: Error: Unable to find ematch "canid" in /etc/iproute2/ematch_map Please assign a unique ID to the ematch kind the suggested entry is: 7 canid Signed-off-by: Rostislav Lisovy Signed-off-by: Marc Kleine-Budde --- etc/iproute2/ematch_map | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/iproute2/ematch_map b/etc/iproute2/ematch_map index 69b007d0..18239837 100644 --- a/etc/iproute2/ematch_map +++ b/etc/iproute2/ematch_map @@ -3,4 +3,5 @@ 2 nbyte 3 u32 4 meta +7 canid 8 ipset