[Patch v2 2/2] idiag: add a copy of linux/tcp.h

Cong Wang xiyou.wangcong at gmail.com
Thu Nov 20 16:00:14 PST 2014


(Sorry for the delay, I missed this email)

On Fri, Nov 7, 2014 at 3:28 AM, Thomas Graf <tgraf at suug.ch> wrote:
> On 11/07/14 at 11:25am, Thomas Graf wrote:
>> On 10/27/14 at 09:50am, Cong Wang wrote:
>> > Similarly, there are some fields in struct tcp_info
>> > which are not available on older kenrels.
>> >
>> > Note, now libnl could return a larger tcp_info if it runs
>> > on an older kernel, but it should be fine as long as we
>> > don't return smaller.
>>
>> That only works as long as the libnl header copy is more or
>> equally recent as the installed tcp_info definition. Otherwise
>> behaviour is mostly undefined.
>>
>> We need to come up with something that is more stable.
>
> I agree to this patch if the behaviour is properly documented as in
> explaining that parts might stay uninitialized. It's already broken
> like that and we can't fix it for existing callers.

Let me know if you want me to resend this patch with a better
changelog or just drop it.

>
> We should provide a new API though which takes a pointer to a tcp_info
> plus length, initializes it properly and copies what is available.
>
> The new API should be referred to in the doc of the old API.

Yeah, we should have a better API, but we still have to keep
ABI compatibility.

Thanks.



More information about the libnl mailing list