Folks,
I've been bitten several times now by the fact that FIB values do not survive
going through a divert socket. This is resolved by giving a divert socket its
own type that stores this information (and potentially more in the future).
I've attached a patch that would resolve 2 things:
a) interface names that are longer than 7 characters (someone suggested this
somewhere for interfaces with auto generated names).
b) FIB's getting lost after going through a divert socket (for example with
natd).
I am now using the following structure:
struct sockaddr_div {
uint8_t sdiv_len;
sa_family_t sdiv_family;
in_port_t sdiv_port;
struct in_addr sdiv_addr;
char sdiv_ifnam[IF_NAMESIZE]; // name of
incoming interface or "\0"
uint16_t sdiv_fib; // routing fib
};
This should be a no-op for most cases, like natd, that reuse the sockaddr_in as
is. I cannot find any relevant reference to sin_zero in base, but for cases
where the interface name is read it should be a no-op as well, unless . This
code is in use here, and seems to work fine, but additional testing is
obviously welcome.
Patch attached.
As this is an API change, I would appreciate some feedback on whether this is a
good idea, whether more information should be stored in the struct, etc.
Second, is this something that should be MFCed?
Regards,
Nick Hibma
[email protected]
-- Open Source: We stand on the shoulders of giants.
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "[email protected]"