From 7ba19d412a0e8dc762a86f7ccbbdf4e39133cc71 Mon Sep 17 00:00:00 2001 From: Alexandru Copot Date: Sat, 7 Sep 2013 12:35:14 +0300 Subject: [PATCH] netdev: update IFF_LOOPBACK flag for linux and bsd devices Signed-off-by: Alexandru Copot Signed-off-by: Ben Pfaff --- AUTHORS | 1 + lib/netdev-bsd.c | 6 ++++++ lib/netdev-linux.c | 6 ++++++ 3 files changed, 13 insertions(+) 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; } -- 2.47.0