From d3cf89ea9459ddfc1b35ef0a927ec8c969e07a5e Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Fri, 5 Apr 2013 10:37:55 +0200 Subject: [PATCH] addr: only translate more recent address family names and ARP types if defined Helps making libnl compilable with older kernel headers Signed-off-by: Thomas Graf --- lib/addr.c | 8 ++++++++ lib/utils.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/lib/addr.c b/lib/addr.c index 557b0ad..86e7e58 100644 --- a/lib/addr.c +++ b/lib/addr.c @@ -1037,10 +1037,18 @@ static const struct trans_tbl afs[] = { __ADD(AF_RXRPC,rxrpc) __ADD(AF_ISDN,isdn) __ADD(AF_PHONET,phonet) +#ifdef AF_IEEE802154 __ADD(AF_IEEE802154,ieee802154) +#endif +#ifdef AF_CAIF __ADD(AF_CAIF,caif) +#endif +#ifdef AF_ALG __ADD(AF_ALG,alg) +#endif +#ifdef AF_NFC __ADD(AF_NFC,nfc) +#endif }; char *nl_af2str(int family, char *buf, size_t size) diff --git a/lib/utils.c b/lib/utils.c index 3012fea..4457b1f 100644 --- a/lib/utils.c +++ b/lib/utils.c @@ -685,7 +685,9 @@ static const struct trans_tbl llprotos[] = { __ADD(ARPHRD_IEEE802_TR,tr) __ADD(ARPHRD_IEEE80211,ieee802.11) __ADD(ARPHRD_PHONET,phonet) +#ifdef ARPHRD_CAIF __ADD(ARPHRD_CAIF, caif) +#endif #ifdef ARPHRD_IEEE80211_PRISM __ADD(ARPHRD_IEEE80211_PRISM, ieee802.11_prism) #endif -- 2.40.0