Subject: Re: [PATCH iproute2] tc: fix compilation with old gcc (< 4.6) (bis)

From: Nicolas Dichtel <[email-masked]>
Date: Tue, 2 Feb 2016 11:39:28 +0100

Le 02/02/2016 10:08, Daniel Borkmann a écrit :
> On 02/02/2016 05:51 AM, Stephen Hemminger wrote:
>> On Tue, 19 Jan 2016 11:01:45 +0000
>> Nicolas Dichtel <[email-masked]> wrote:
>>
>>> diff --git a/tc/tc_bpf.c b/tc/tc_bpf.c
>>> index 42c8841869f5..219ffa582c1a 100644
>>> --- a/tc/tc_bpf.c
>>> +++ b/tc/tc_bpf.c
>>> @@ -49,6 +49,10 @@
>>>   #include "tc_util.h"
>>>   #include "tc_bpf.h"
>>>
>>> +#ifndef AF_ALG
>>> +#define AF_ALG 38
>>> +#endif
>>
>> Why is this here? AF_ALG is not used anywhere in this code.
>
> It is used, this patch is fine as-is.
Yes, it's used and not defined with old toolchains:
$ git grep AF_ALG
tc/tc_bpf.c:#ifndef AF_ALG
tc/tc_bpf.c:#define AF_ALG 38
tc/tc_bpf.c:            .salg_family    = AF_ALG,
tc/tc_bpf.c:    cfd = socket(AF_ALG, SOCK_SEQPACKET, 0);
tc/tc_bpf.c:            fprintf(stderr, "Cannot get AF_ALG socket: %s\n",

Regards,
Nicolas