2004-12-21 Paul Jakma <paul.jakma@sun.com>
* if.h: Add more 'non-generic' IFF_ flags.
* if.c: IFF_NOXMIT/IFF_VIRTUAL interfaces are 'loopback like'
diff --git a/lib/ChangeLog b/lib/ChangeLog
index 6eb70a2..065cddd 100644
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2004-12-21 Paul Jakma <paul.jakma@sun.com>
+
+ * if.h: Add more 'non-generic' IFF_ flags.
+ * if.c: IFF_NOXMIT/IFF_VIRTUAL interfaces are 'loopback like'
+
2004-12-17 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
* command.c: (do_echo) Added new "echo" command, useful for
diff --git a/lib/if.c b/lib/if.c
index 5519b2a..c7ced18 100644
--- a/lib/if.c
+++ b/lib/if.c
@@ -344,7 +344,10 @@
int
if_is_loopback (struct interface *ifp)
{
- return ifp->flags & IFF_LOOPBACK;
+ /* XXX: Do this better, eg what if IFF_WHATEVER means X on platform M
+ * but Y on platform N?
+ */
+ return (ifp->flags & (IFF_LOOPBACK|IFF_NOXMIT|IFF_VIRTUAL));
}
/* Does this interface support broadcast ? */
@@ -376,7 +379,7 @@
static char logbuf[BUFSIZ];
#define IFF_OUT_LOG(X,STR) \
- if ((X) && (flag & (X))) \
+ if (flag & (X)) \
{ \
if (separator) \
strlcat (logbuf, ",", BUFSIZ); \
@@ -402,10 +405,11 @@
IFF_OUT_LOG (IFF_LINK1, "LINK1");
IFF_OUT_LOG (IFF_LINK2, "LINK2");
IFF_OUT_LOG (IFF_MULTICAST, "MULTICAST");
-#ifdef SOLARIS_IPV6
- IFF_OUT_LOG (IFF_IPV4, "IFF_IPv4");
- IFF_OUT_LOG (IFF_IPV6, "IFF_IPv6");
-#endif /* SOLARIS_IPV6 */
+ IFF_OUT_LOG (IFF_NOXMIT, "NOXMIT");
+ IFF_OUT_LOG (IFF_NORTEXCH, "NORTEXCH");
+ IFF_OUT_LOG (IFF_VIRTUAL, "VIRTUAL");
+ IFF_OUT_LOG (IFF_IPV4, "IPv4");
+ IFF_OUT_LOG (IFF_IPV6, "IPv6");
strlcat (logbuf, ">", BUFSIZ);
diff --git a/lib/if.h b/lib/if.h
index 7afb2ae..492a63c 100644
--- a/lib/if.h
+++ b/lib/if.h
@@ -190,6 +190,21 @@
#ifndef IFF_LINK2
#define IFF_LINK2 0x0
#endif /* IFF_LINK2 */
+#ifndef IFF_NOXMIT
+#define IFF_NOXMIT 0x0
+#endif /* IFF_NOXMIT */
+#ifndef IFF_NORTEXCH
+#define IFF_NORTEXCH 0x0
+#endif /* IFF_NORTEXCH */
+#ifndef IFF_IPV4
+#define IFF_IPV4 0x0
+#endif /* IFF_IPV4 */
+#ifndef IFF_IPV6
+#define IFF_IPV6 0x0
+#endif /* IFF_IPV6 */
+#ifndef IFF_VIRTUAL
+#define IFF_VIRTUAL 0x0
+#endif /* IFF_VIRTUAL */
/* Prototypes. */
int if_cmp_func (struct interface *, struct interface *);