[Olsr-dev] Problem with compile olsrd on SDK AirmaxOS

Conrad Lara (spam-protected)
Mon Nov 10 18:56:35 CET 2014


It was Waldek with the compile issue for IPV6_V6ONLY 

My setup compiled clean with just the the first patch removing the reference to IPV6_TCLASS (which I actually did weeks ago)

Explains why I didn't see the IPV6_V6ONLY issue however as 7.09 has 2.4.34 for the kernel base.

As I suggested, I recommend a policy decision on minimum supported versions (kernel, GCC, etc) and anything outside those specs is "unsupported" vs polluting the code base with lines that no one is maintaining.  This is why I never brought the issue forward when I hit it as I figured it was probably old enough not to be a worry.

I've already hit my share of issue in olsrd related to code rot, more lines of code isn't always a good thing.

Sent from my iPhone

> On Nov 10, 2014, at 5:58 AM, Ferry Huberts <(spam-protected)> wrote:
> 
> @Conrad:
> 
> This means that the only thing you have to do is to upgrade your kernel to at least 2.4.21 and you can use IPV6_V6ONLY
> 
> 
>> On 10/11/14 14:56, Ferry Huberts wrote:
>> 
>> 
>>> On 10/11/14 14:03, Henning Rogge wrote:
>>> The patches look reasonable, they should not be a problem with the
>>> current kernels.
>>> 
>>> Ferry, do you see a problem with these changes?
>> 
>> 
>> mmm, I guess I do.
>> Didn't we already have some kernel version detection somewhere?
>> I'd rather use something like that.
>> 
>> Ah, found it, see olsrd_conf.c line 544 for an example:
>> 
>>> #if !defined LINUX_VERSION_CODE || !defined KERNEL_VERSION
>>> #error "Both LINUX_VERSION_CODE and KERNEL_VERSION need to be defined"
>>> #else /* !defined LINUX_VERSION_CODE || !defined KERNEL_VERSION */
>>> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
>>> if (cnf->ip_version == AF_INET6 && cnf->smart_gw_active) {
>>> fprintf(stderr, "Smart gateways are not supported for linux kernel
>>> < 2.6.24 and ipv6\n");
>>> return -1;
>>> }
>>> #endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) */
>> 
>> 
>> 
>> According to 'man 7 ipv6':
>> 
>>>   IPV6_V6ONLY (since Linux 2.4.21 and 2.6)
>>>           If  this flag is set to true (nonzero), then the socket
>>> is restricted to sending and receiving IPv6 packets only.  In this
>>>           case, an IPv4 and an IPv6 application can bind to a
>>> single port at the same time.
>>> 
>>>           If this flag is set to false (zero), then the socket can
>>> be used to send and receive packets to and from an  IPv6  address
>>>           or an IPv4-mapped IPv6 address.
>>> 
>>>           The argument is a pointer to a boolean value in an integer.
>>> 
>>>           The  default  value for this flag is defined by the
>>> contents of the file /proc/sys/net/ipv6/bindv6only.  The default value
>>>           for that file is 0 (false).
>> 
>> 
>> 
>> 
>>> 
>>> Hennig
>>> 
>>> On Mon, Nov 10, 2014 at 1:56 PM, Waldek SPdwaONG <(spam-protected)>
>>> wrote:
>>>> Hi,
>>>> 
>>>> One big problem for old devices UBNT like NS2 (not NS Mx models)
>>>> where we
>>>> use AirMAX OS SDK which have kernel 2.4.x and if we want to use
>>>> latest olsr
>>>> we have problem with compile (but after apply patch now OK).
>>>> I have try use OpenWRT Attitude Adjustment on NS2 but is is not
>>>> enough space
>>>> to load olsrd with plugins and  it is very slow WEB interface compare to
>>>> original AirMAX OS. One way with NS2 NS5 etc UBNT is use Backfire
>>>> 10.03.1
>>>> but WEB interface is slowly to compare AirMAX OS for this reason we
>>>> can only
>>>> use AirMAX SDK with kernel 2.4 or Backfire OpenWRT.
>>>> This patch is necessary for unix/iface.c
>>>> and lib/txtinfo/src/olsrd_txtinfo.c,
>>>> lib/jsoninfo/src/olsrd_jsoninfo.c to
>>>> problem with "IPV6_V6ONLY"
>>>> 
>>>> I have apply (it is work but I am not sure that iti is correct place):
>>>> 
>>>> #if defined linux
>>>>  if (jsoninfo_ipv6_only && olsr_cnf->ip_version == AF_INET6) {
>>>> #ifdef IPV6_V6ONLY
>>>>    if (setsockopt(ipc_socket, IPPROTO_IPV6, IPV6_V6ONLY, (char
>>>> *)&yes,
>>>> sizeof(yes)) < 0) {
>>>>      perror("IPV6_V6ONLY failed");
>>>>      return 0;
>>>>    }
>>>> #endif
>>>>  }
>>>> #endif /* defined linux */
>>>>  /* Bind the socket */
>>>> 
>>>> and for olsrd_txtinfo.c
>>>> 
>>>> #if defined linux
>>>>  if (txtinfo_ipv6_only && olsr_cnf->ip_version == AF_INET6) {
>>>> #ifdef IPV6_V6ONLY
>>>>    if (setsockopt(ipc_socket, IPPROTO_IPV6, IPV6_V6ONLY, (char
>>>> *)&yes,
>>>> sizeof(yes)) < 0) {
>>>>      perror("IPV6_V6ONLY failed");
>>>>      return 0;
>>>>    }
>>>> #endif
>>>>  }
>>>> #endif /* defined linux */
>>>>  /* Bind the socket */
>>>> 
>>>> 
>>>> 2014-11-10 10:11 GMT+01:00 Henning Rogge <(spam-protected)>:
>>>>> 
>>>>>> On Sun, Nov 9, 2014 at 9:07 PM,  <(spam-protected)> wrote:
>>>>>> Sorry for asking this but I have use (and others ) Nanostation 2 which
>>>>>> we
>>>>>> can use only old kernel 2.4.x.
>>>>> 
>>>>> I think OpenWRT Attitude Adjustment should run on a 4MB flash device.
>>>>> 
>>>>> In fact I have used kernel 2.6 on the original (pre 802.11n) Ubiquiti
>>>>> hardware.
>>>>> 
>>>>> What do you think of a deal... you start looking for the places where
>>>>> you get errors (and eliminate them by commenting them out) and post
>>>>> them here and I look if we can do an easy patch for them that wont
>>>>> break too much for you.
>>>>> 
>>>>> Henning Rogge
>>>> 
>>>> 
>>>> 
>>>> --
>>>> Waldek sp2ong
> 
> -- 
> Ferry Huberts




More information about the Olsr-dev mailing list