Hi,

I know, IPv4 is deprecated and will be removed soon...
Until that day comes, these patches will help me a lot on some of our
servers.

We have a VLAN, where our customers have IPv4 Networks with private IPs
(rfc1918). The most favourite addresses are 192.168.1.* and so, normal
routing doesn't work.

The servers, that we are using, to access those customer networks are:
Solaris 10
RedHat Linux with policy routing

Policy Routing is nice - i can just bind an IP address to a socket and
the kernel routes those packets through that interface - everything is
fine.

On the Solaris servers, i don't have that. I have to connect directly
to the interface by name.

Some years ago, i already sent in a patch for binding an IP address to
a socket and those patches have been accepted - i can see them in the
code. That helps on Linux with policy routing.

The new patches will add that binding by interface name and also let the
tools (snmpwalk, snmpget, ...) make use of the new features.

snmplib/snmp_parse_args.c
I have chosen "q" and "Q" for the parameters "local IP" and "local
interface", because these are not in use in 5.7. You might find, that
these are inappropriate for any reason and change them.

include/net-snmp/library/default_store.h
I used the next free number (35) for the local interface. That can be
changed to any other number.

snmplib/transports/snmpUDPBaseDomain.c
At first, i used setsockopt with SO_BINDTODEVICE, to bind a socket to
an interface on Solaris. Later, i got another RedHat Server, that
didn't have policy routing. So i had to add some code to
netsnmp_udpbase_sendto, which sets values in the struct iovec.

perl/SNMP/SNMP.pm and perl/SNMP/SNMP.pm
small changes allow the perl modules, to make use of interface binding
too. You might like to change the names for the parameters...

There's a txtfile attached, that has been created with "diff -c" on all
files, that i changed. I hope, this is convenient for you.

-- 
mit freundlichen Gruessen / with friendly regards
Michael Buchholz  [email protected]   MSAS Support
Verizon Business  Sebrathweg 20  44149 Dortmund  Germany   Vnet: 3171192
Tel: +492319721192     Fax: +492319722508     Home-Office: +492319479858



Verizon Deutschland GmbH - Sebrathweg 20, 44149 Dortmund, Germany - Amtsgericht 
Dortmund, HRB 14952 - Geschäftsführer: Detlef Eppig - Vorsitzender des 
Aufsichtsrats: Dominique Gaillard


Attachment: net-snmp-5.7-changes.txt
Description: Binary data

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to