From: Alexandru Copot Date: Sat, 7 Sep 2013 09:35:14 +0000 (+0300) Subject: netdev: update IFF_LOOPBACK flag for linux and bsd devices X-Git-Tag: sliver-openvswitch-2.0.90-1~15^2~24 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=7ba19d412a0e8dc762a86f7ccbbdf4e39133cc71;p=sliver-openvswitch.git netdev: update IFF_LOOPBACK flag for linux and bsd devices Signed-off-by: Alexandru Copot Signed-off-by: Ben Pfaff --- diff --git a/AUTHORS b/AUTHORS index a708fb2a7..d41616009 100644 --- a/AUTHORS +++ b/AUTHORS @@ -2,6 +2,7 @@ The following people, in alphabetical order, have either authored or signed off on commits in the Open vSwitch version control repository. Aaron Rosen arosen@clemson.edu +Alexandru Copot alex.mihai.c@gmail.com Alexey I. Froloff raorn@altlinux.org Alex Wang alexw@nicira.com Andrew Evans aevans@nicira.com diff --git a/lib/netdev-bsd.c b/lib/netdev-bsd.c index fdea10b96..3eb29ea6a 100644 --- a/lib/netdev-bsd.c +++ b/lib/netdev-bsd.c @@ -1428,6 +1428,9 @@ nd_to_iff_flags(enum netdev_flags nd) iff |= IFF_PPROMISC; #endif } + if (nd & NETDEV_LOOPBACK) { + iff |= IFF_LOOPBACK; + } return iff; } @@ -1441,6 +1444,9 @@ iff_to_nd_flags(int iff) if (iff & IFF_PROMISC) { nd |= NETDEV_PROMISC; } + if (iff & IFF_LOOPBACK) { + nd |= NETDEV_LOOPBACK; + } return nd; } diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index 26fb32d82..2752623d3 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -2510,6 +2510,9 @@ nd_to_iff_flags(enum netdev_flags nd) if (nd & NETDEV_PROMISC) { iff |= IFF_PROMISC; } + if (nd & NETDEV_LOOPBACK) { + iff |= IFF_LOOPBACK; + } return iff; } @@ -2523,6 +2526,9 @@ iff_to_nd_flags(int iff) if (iff & IFF_PROMISC) { nd |= NETDEV_PROMISC; } + if (iff & IFF_LOOPBACK) { + nd |= NETDEV_LOOPBACK; + } return nd; }