]> granicus.if.org Git - libnl/commitdiff
addr: only translate more recent address family names and ARP types if defined
authorThomas Graf <tgraf@suug.ch>
Fri, 5 Apr 2013 08:37:55 +0000 (10:37 +0200)
committerThomas Graf <tgraf@suug.ch>
Fri, 5 Apr 2013 08:37:55 +0000 (10:37 +0200)
Helps making libnl compilable with older kernel headers

Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/addr.c
lib/utils.c

index 557b0ada823afe69940e23de287bfbc5670fde86..86e7e58e2d4dec25cf24ce289ce3f900ff43c6f0 100644 (file)
@@ -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)
index 3012fea9d59f62ddb3a754ec2c2a2a84b83dcbeb..4457b1f26e01b5969fc7285de65e72110d5b9b9f 100644 (file)
@@ -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