All the actual netlinks have this, and proper ICMP generation on
point-to-point links is going to need it.
The dummy "null" netlink previously didn't have this parameter; now,
it is mandatory. This is an incompatible configuration change, but
only for configurations which contain a null netlink - which we think
is only done for testing or debugging.
No other functional change.
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
st->remote_networks=ipset_complement(empty);
ipset_free(empty);
}
st->remote_networks=ipset_complement(empty);
ipset_free(empty);
}
+ st->local_address=string_item_to_ipaddr(
+ dict_find_item(dict,"local-address", True, "netlink", loc),"netlink");
sa=dict_find_item(dict,"secnet-address",False,"netlink",loc);
ptpa=dict_find_item(dict,"ptp-address",False,"netlink",loc);
sa=dict_find_item(dict,"secnet-address",False,"netlink",loc);
ptpa=dict_find_item(dict,"ptp-address",False,"netlink",loc);
struct ipset *networks; /* Local networks */
struct subnet_list *subnets; /* Same as networks, for display */
struct ipset *remote_networks; /* Allowable remote networks */
struct ipset *networks; /* Local networks */
struct subnet_list *subnets; /* Same as networks, for display */
struct ipset *remote_networks; /* Allowable remote networks */
+ uint32_t local_address; /* host interface address */
uint32_t secnet_address; /* our own address, or the address of the
other end of a point-to-point link */
bool_t ptp;
uint32_t secnet_address; /* our own address, or the address of the
other end of a point-to-point link */
bool_t ptp;
bool_t ignoring_packet; /* If this packet was corrupt or overlong,
we ignore everything up to the next END */
netlink_deliver_fn *netlink_to_tunnel;
bool_t ignoring_packet; /* If this packet was corrupt or overlong,
we ignore everything up to the next END */
netlink_deliver_fn *netlink_to_tunnel;
- uint32_t local_address;
};
/* Generic SLIP mangling code */
};
/* Generic SLIP mangling code */
netlink_init(&st->nl,st,loc,dict,
"netlink-userv-ipif",NULL,to_host);
st->buff=find_cl_if(dict,"buffer",CL_BUFFER,True,"name",loc);
netlink_init(&st->nl,st,loc,dict,
"netlink-userv-ipif",NULL,to_host);
st->buff=find_cl_if(dict,"buffer",CL_BUFFER,True,"name",loc);
- st->local_address=string_item_to_ipaddr(
- dict_find_item(dict,"local-address", True, name, loc),"netlink");
BUF_ALLOC(st->buff,"slip_init");
st->pending_esc=False;
st->ignoring_packet=False;
BUF_ALLOC(st->buff,"slip_init");
st->pending_esc=False;
st->ignoring_packet=False;
addrs=safe_malloc(512,"userv_invoke_userv:addrs");
snprintf(addrs,512,"%s,%s,%d,slip",
addrs=safe_malloc(512,"userv_invoke_userv:addrs");
snprintf(addrs,512,"%s,%s,%d,slip",
- ipaddr_to_string(st->slip.local_address),
+ ipaddr_to_string(st->slip.nl.local_address),
ipaddr_to_string(st->slip.nl.secnet_address),st->slip.nl.mtu);
allnets=ipset_new();
ipaddr_to_string(st->slip.nl.secnet_address),st->slip.nl.mtu);
allnets=ipset_new();
struct buffer_if *buff; /* We receive packets into here
and send them to the netlink code. */
netlink_deliver_fn *netlink_to_tunnel;
struct buffer_if *buff; /* We receive packets into here
and send them to the netlink code. */
netlink_deliver_fn *netlink_to_tunnel;
- uint32_t local_address; /* host interface address */
};
static cstring_t tun_flavour_str(uint32_t flavour)
};
static cstring_t tun_flavour_str(uint32_t flavour)
to set the TUN device's address, and route to add routes to all
our networks. */
to set the TUN device's address, and route to add routes to all
our networks. */
- hostaddr=ipaddr_to_string(st->local_address);
+ hostaddr=ipaddr_to_string(st->nl.local_address);
secnetaddr=ipaddr_to_string(st->nl.secnet_address);
snprintf(mtu,sizeof(mtu),"%d",st->nl.mtu);
mtu[5]=0;
secnetaddr=ipaddr_to_string(st->nl.secnet_address);
snprintf(mtu,sizeof(mtu),"%d",st->nl.mtu);
mtu[5]=0;
sa=(struct sockaddr_in *)&ifr.ifr_addr;
FILLZERO(*sa);
sa->sin_family=AF_INET;
sa=(struct sockaddr_in *)&ifr.ifr_addr;
FILLZERO(*sa);
sa->sin_family=AF_INET;
- sa->sin_addr.s_addr=htonl(st->local_address);
+ sa->sin_addr.s_addr=htonl(st->nl.local_address);
if (ioctl(fd,SIOCSIFADDR, &ifr)!=0) {
fatal_perror("tun_apply: SIOCSIFADDR");
}
if (ioctl(fd,SIOCSIFADDR, &ifr)!=0) {
fatal_perror("tun_apply: SIOCSIFADDR");
}
st->route_path=dict_read_string(dict,"route-path",False,"tun-netlink",loc);
st->buff=find_cl_if(dict,"buffer",CL_BUFFER,True,"tun-netlink",loc);
st->route_path=dict_read_string(dict,"route-path",False,"tun-netlink",loc);
st->buff=find_cl_if(dict,"buffer",CL_BUFFER,True,"tun-netlink",loc);
- st->local_address=string_item_to_ipaddr(
- dict_find_item(dict,"local-address", True, "netlink", loc),"netlink");
if (st->tun_flavour==TUN_FLAVOUR_GUESS) {
/* If we haven't been told what type of TUN we're using, take
if (st->tun_flavour==TUN_FLAVOUR_GUESS) {
/* If we haven't been told what type of TUN we're using, take