mirror of git://git.sysmocom.de/ofono
gisi: Remove unused code for PN netlink address handling
This commit is contained in:
parent
ebb82bee81
commit
4c11468094
|
@ -112,34 +112,6 @@ static int pn_netlink_socket(void)
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void pn_netlink_addr(GIsiPhonetNetlink *self, struct nlmsghdr *nlh)
|
|
||||||
{
|
|
||||||
int len;
|
|
||||||
uint8_t local = 0xff;
|
|
||||||
uint8_t remote = 0xff;
|
|
||||||
|
|
||||||
const struct ifaddrmsg *ifa;
|
|
||||||
const struct rtattr *rta;
|
|
||||||
|
|
||||||
ifa = NLMSG_DATA(nlh);
|
|
||||||
len = IFA_PAYLOAD(nlh);
|
|
||||||
|
|
||||||
/* If Phonet is absent, kernel transmits other families... */
|
|
||||||
if (ifa->ifa_family != AF_PHONET)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (ifa->ifa_index != g_isi_modem_index(self->modem))
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (rta = IFA_RTA(ifa); RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
|
|
||||||
|
|
||||||
if (rta->rta_type == IFA_LOCAL)
|
|
||||||
local = *(uint8_t *)RTA_DATA(rta);
|
|
||||||
else if (rta->rta_type == IFA_ADDRESS)
|
|
||||||
remote = *(uint8_t *)RTA_DATA(rta);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
static void pn_netlink_link(GIsiPhonetNetlink *self, struct nlmsghdr *nlh)
|
static void pn_netlink_link(GIsiPhonetNetlink *self, struct nlmsghdr *nlh)
|
||||||
{
|
{
|
||||||
const struct ifinfomsg *ifi;
|
const struct ifinfomsg *ifi;
|
||||||
|
@ -223,16 +195,10 @@ static gboolean pn_netlink_process(GIOChannel *channel, GIOCondition cond,
|
||||||
strerror(-err->error));
|
strerror(-err->error));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
case RTM_NEWADDR:
|
|
||||||
case RTM_DELADDR:
|
|
||||||
pn_netlink_addr(self, nlh);
|
|
||||||
break;
|
|
||||||
case RTM_NEWLINK:
|
case RTM_NEWLINK:
|
||||||
case RTM_DELLINK:
|
case RTM_DELLINK:
|
||||||
pn_netlink_link(self, nlh);
|
pn_netlink_link(self, nlh);
|
||||||
break;
|
break;
|
||||||
default:
|
|
||||||
continue;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
Loading…
Reference in New Issue