Generating RTM_IFINFO messages on interface description change?

Nikolay Denev ndenev at gmail.com
Wed Dec 15 17:16:07 UTC 2010


On 13 Dec, 2010, at 13:21 , Nikolay Denev wrote:

> Hello,
> 
> I'm currently trying to enable bsnmpd to export the interface
> descriptions that are supported on FreeBSD 8+ as ifDescr and
> while doing it I'm wondering if RTM_IFINFO msgs should be generated
> on description set/change. This would greatly simplify the functionality
> in bsnmpd and would prevent needless polls/ioctls.
> 
> My opinion is that it probably is OK to generate RTM_IFINFO on this event but are there other opinions?
> 
> 
> Regards,
> Nikolay

Ok,

This simple patch will enable the RTM_IFINFO messages when interface description is changed :

--- /usr/src/sys/net.old/if.c	2010-12-15 17:32:59.000000000 +0100
+++ /usr/src/sys/net/if.c	2010-12-15 17:36:08.000000000 +0100
@@ -2176,6 +2176,7 @@
 
 		getmicrotime(&ifp->if_lastchange);
 		free(odescrbuf, M_IFDESCR);
+		rt_ifmsg(ifp);
 		break;
 
 	case SIOCSIFFLAGS:


With this patch the message will be generated, but without information about what changed.
But I wonder if adding the description in if_data isn't too much...




More information about the freebsd-net mailing list