patchlwIP - A Lightweight TCP/IP stack - Patches: patch #5778, Warning in opt.h about SO_REUSE

 
 

You are not allowed to post comments on this tracker with your current authentication level.

patch #5778: Warning in opt.h about SO_REUSE

Submitter:  Frédéric Bernon <fbernon>
Submitted:  Sun 04 Mar 2007 01:36:04 PM UTC
   
 
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  fbernon Open/Closed:  Closed
Planned Release:  None

Mon 05 Mar 2007 09:23:19 AM UTC, comment #3: 

1. In fact, this patch is only to remove warning at build time. But, if someone upgrades from an older version, there is two possibilities :

- he never define SO_REUSE, in this case, no warning at build time, and if he execute his program, setsockopt will give a ENOPROTOOPT runtime error.

- he already set SO_REUSE to 1 in his lwipopts.h, in this case, he will get the error message "SO_REUSE currently unavailable..." at build time. He just have to remove SO_REUSE in his lwipiopts.h

2. I hope perhaps "someone" will fix the code (like you with APR_QUEUING). But I even if the lwip current design is to tell "one thread at one netconn (and thus socket) at a time", you can use SO_REUSEADDR to allow two differents sockets to receive the same broadcast or multicast UDP "streams".

So, that's why I have propose this patch...

Frédéric Bernon <fbernon>
Group Member
Mon 05 Mar 2007 09:20:19 AM UTC, comment #2: 

If they're upgrading they'll get a compile error when they compile lwIP.

I'd have no objection to removing broken code though.  Perhaps we should consult lwip-users first.

Kieran Mansley <kieranm>
Group Member
Mon 05 Mar 2007 07:15:44 AM UTC, comment #1: 

1. If someone relies on the SO_REUSE funcionality and upgrades from an older version, he won't get a warning but instead his program will simply fail.
2. Why don't we throw away the whole SO_REUSE code if it doesn't work anyway? I don't know when and why it was turned off, though. With the recent discussion about only supporting one thread at one netconn (and thus socket) at a time, I don't think we can support SO_REUSE anyway!

Simon Goldschmidt <goldsimon>
Group administrator
Sun 04 Mar 2007 01:36:04 PM UTC, original submission:  

The current SO_REUSE define in opt.h give a warning. A simple patch will be to define it like this :

/* ---------- Socket Options ---------- */
/* Enable SO_REUSEADDR and SO_REUSEPORT options */

#ifndef SO_REUSE
#define SO_REUSE                        0
#endif

#if SO_REUSE
/* I removed the lot since this was an ugly hack. It broke the raw-API.
   It also came with many ugly goto's, Christiaan Simons. */
#error "SO_REUSE currently unavailable, this was a hack"
#endif                                                                       


Is it ok for you?

Frédéric Bernon <fbernon>
Group Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by kieranm (Posted a comment)
  • -email is unavailable- added by goldsimon (Posted a comment)
  • -email is unavailable- added by fbernon (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2007-03-05 fbernon StatusIn Progress Done
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code