[Click] ipv6 and fromhost
John Bicket
jbicket at mit.edu
Mon Jul 21 23:42:53 EDT 2003
Hi,
Fromhost needs a ip4 address to initialize; I was doing some ip6 stuff and wondered
if the ip/netmask could be changed to a keyword instead of an argument.
Something like this:
Thanks,
--john
Index: fromhost.cc
===================================================================
RCS file: /home/am0/click/cvsroot/release/one/elements/linuxmodule/fromhost.cc,v
retrieving revision 1.44
diff -r1.44 fromhost.cc
122d121
< cpIPPrefix, "destination IP prefix", &_destaddr, &_destmask,
123a123
> "IP", cpIPPrefix, "destination IP prefix", &_destaddr, &_destmask,
194,202c194,203
< sin->sin_family = AF_INET;
< sin->sin_addr = _destaddr;
< if (res >= 0 && (res = devinet_ioctl(SIOCSIFADDR, &ifr)) < 0)
< errh->error("error %d setting address for device `%s'", res, _devname.cc());
<
< sin->sin_addr = _destmask;
< if (res >= 0 && (res = devinet_ioctl(SIOCSIFNETMASK, &ifr)) < 0)
< errh->error("error %d setting netmask for device `%s'", res, _devname.cc());
<
---
> if (_destaddr != IPAddress()) {
> sin->sin_family = AF_INET;
> sin->sin_addr = _destaddr;
> if (res >= 0 && (res = devinet_ioctl(SIOCSIFADDR, &ifr)) < 0)
> errh->error("error %d setting address for device `%s'", res, _devname.cc());
>
> sin->sin_addr = _destmask;
> if (res >= 0 && (res = devinet_ioctl(SIOCSIFNETMASK, &ifr)) < 0)
> errh->error("error %d setting netmask for device `%s'", res, _devname.cc());
> }
More information about the click
mailing list