Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 265811 Details for
Bug 275112
new ebuilds: net-libs/libpdel-0.5.3 and net-dialup/mpd-4.4.1
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
libpdel-0.5.3-fbsd.patch for fbsd-8.0 got from FreeBSD port
libpdel-0.5.3-fbsd.patch (text/plain), 14.35 KB, created by
Dmitri Bogomolov
on 2011-03-14 12:55:13 UTC
(
hide
)
Description:
libpdel-0.5.3-fbsd.patch for fbsd-8.0 got from FreeBSD port
Filename:
MIME Type:
Creator:
Dmitri Bogomolov
Created:
2011-03-14 12:55:13 UTC
Size:
14.35 KB
patch
obsolete
>--- net/uroute.c.prev 2005-01-21 23:02:03.000000000 +0200 >+++ net/uroute.c 2008-12-24 21:34:43.000000000 +0200 >@@ -74,9 +74,15 @@ > ((a) > 0 ? (1 + (((a) - 1) | (sizeof(long) - 1))) : sizeof(long)) > #define ADVANCE(x, n) ((x) += ROUNDUP((n)->sa_len)) > >+#ifdef RTF_CLONING > #define WRITABLE_FLAGS (RTF_STATIC | RTF_LLINFO | RTF_REJECT | RTF_BLACKHOLE \ > | RTF_PROTO1 | RTF_PROTO2 | RTF_CLONING \ > | RTF_XRESOLVE | RTF_UP | RTF_GATEWAY) >+#else >+#define WRITABLE_FLAGS (RTF_STATIC | RTF_REJECT | RTF_BLACKHOLE \ >+ | RTF_PROTO1 | RTF_PROTO2 \ >+ | RTF_XRESOLVE | RTF_UP | RTF_GATEWAY) >+#endif > > struct route_flag { > const char *name; >@@ -92,15 +98,21 @@ static const struct route_flag route_fla > FLAG(DYNAMIC), > FLAG(MODIFIED), > FLAG(DONE), >+#ifdef RTF_CLONING > FLAG(CLONING), >+#endif > FLAG(XRESOLVE), >+#ifdef RTF_LLINFO > FLAG(LLINFO), >+#endif > FLAG(STATIC), > FLAG(BLACKHOLE), > FLAG(PROTO2), > FLAG(PROTO1), > FLAG(PRCLONING), >+#ifdef RTF_WASCLONED > FLAG(WASCLONED), >+#endif > FLAG(PROTO3), > FLAG(PINNED), > FLAG(LOCAL), >--- net/if_arp.c.prev 2005-01-21 23:02:02.000000000 +0200 >+++ net/if_arp.c 2008-12-24 23:01:46.000000000 +0200 >@@ -68,7 +68,6 @@ > #include "structs/type/array.h" > > #include "net/if_util.h" >-#include "net/uroute.h" > #include "util/typed_mem.h" > > #define ROUNDUP(a) \ >@@ -124,7 +123,11 @@ if_get_arp(struct in_addr ip, u_char *et > mib[2] = 0; > mib[3] = AF_INET; > mib[4] = NET_RT_FLAGS; >+#ifdef RTF_LLINFO > mib[5] = RTF_LLINFO; >+#else >+ mib[5] = 0; >+#endif > if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) > return (-1); > needed += 128; >@@ -227,9 +230,11 @@ tryagain: > sdl = (struct sockaddr_dl *)(void *) > (ROUNDUP(sin->sin_len) + (char *)sin); > if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) { >- if (sdl->sdl_family == AF_LINK >- && (rtm->rtm_flags & (RTF_LLINFO|RTF_GATEWAY)) >- == RTF_LLINFO) { >+ if (sdl->sdl_family == AF_LINK && >+#ifdef RTF_LLINFO >+ (rtm->rtm_flags & RTF_LLINFO) != 0 && >+#endif >+ (rtm->rtm_flags & RTF_GATEWAY) == 0) { > switch (sdl->sdl_type) { > case IFT_ETHER: > case IFT_FDDI: >@@ -278,6 +283,7 @@ arp_delete(int sock, struct in_addr ip) > struct rt_msghdr *const rtm = &m_rtmsg.m_rtm; > struct sockaddr_dl *sdl; > >+ sdl_m = zero_sdl; > sin_m = zero_sin; > sin->sin_addr = ip; > tryagain: >@@ -286,14 +292,15 @@ tryagain: > sin = (struct sockaddr_inarp *)(rtm + 1); > sdl = (struct sockaddr_dl *)(void *) > (ROUNDUP(sin->sin_len) + (char *)sin); >- if (sin->sin_addr.s_addr == sin_m.sin_addr.s_addr) { >- if (sdl->sdl_family == AF_LINK && >- (rtm->rtm_flags & RTF_LLINFO) && >- !(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) { >+ if (sdl->sdl_family == AF_LINK && >+#ifdef RTF_LLINFO >+ (rtm->rtm_flags & RTF_LLINFO) && >+#endif >+ !(rtm->rtm_flags & RTF_GATEWAY)) switch (sdl->sdl_type) { > case IFT_ETHER: case IFT_FDDI: case IFT_ISO88023: > case IFT_ISO88024: case IFT_ISO88025: >+ sin->sin_addr.s_addr = sin_m.sin_addr.s_addr; > goto delete; >- } > } > if (sin_m.sin_other & SIN_PROXY) { > errno = ENOENT; >@@ -384,42 +391,55 @@ int > if_flush_arp(void) > { > int errno_save = errno; >- struct uroute **list; >- int rtn = 0; >- int num; >- int i; >- >- /* Get list of routes */ >- if ((num = uroute_get_all(&list, TYPED_MEM_TEMP)) == -1) >- return (-1); >- >- /* Delete ARP routes */ >- for (i = 0; i < num; i++) { >- struct uroute *const route = list[i]; >- const struct sockaddr *dest; >- const struct sockaddr *gw; >- >- /* Is this an ARP entry? */ >- dest = uroute_get_dest(route); >- gw = uroute_get_gateway(route); >- if ((uroute_get_flags(route) >- & (RTF_HOST|RTF_LLINFO|RTF_WASCLONED)) >- != (RTF_HOST|RTF_LLINFO|RTF_WASCLONED) >- || dest->sa_family != AF_INET >- || gw->sa_family != AF_LINK) >- continue; >+ int mib[6]; >+ size_t needed; >+ char *lim, *buf, *next; >+ struct rt_msghdr *rtm; >+ struct sockaddr_inarp *sin; >+ struct sockaddr_dl *sdl; >+ int sock, rtn = -1; > >- /* Delete it */ >- if (uroute_delete(route) == -1) { >- errno_save = errno; >- rtn = -1; >- } >+ /* Get socket */ >+ if ((sock = socket(PF_ROUTE, SOCK_RAW, 0)) == -1) >+ return (-1); >+ >+ /* Get ARP table */ >+ mib[0] = CTL_NET; >+ mib[1] = PF_ROUTE; >+ mib[2] = 0; >+ mib[3] = AF_INET; >+ mib[4] = NET_RT_FLAGS; >+#ifdef RTF_LLINFO >+ mib[5] = RTF_LLINFO; >+#else >+ mib[5] = 0; >+#endif >+ if (sysctl(mib, 6, NULL, &needed, NULL, 0) < 0) >+ goto done; >+ needed += 128; >+ if ((buf = MALLOC(TYPED_MEM_TEMP, needed)) == NULL) >+ goto done; >+ if (sysctl(mib, 6, buf, &needed, NULL, 0) < 0) { >+ goto done2; >+ } >+ >+ /* Find desired entry */ >+ lim = buf + needed; >+ for (next = buf; next < lim; next += rtm->rtm_msglen) { >+ rtm = (struct rt_msghdr *)(void *)next; >+ sin = (struct sockaddr_inarp *)(rtm + 1); >+ sdl = (struct sockaddr_dl *)(void *) >+ ((char *)sin + ROUNDUP(sin->sin_len)); >+ if (sdl->sdl_alen == 0) >+ break; >+ arp_delete(sock, sin->sin_addr); > } > >- /* Clean up */ >- while (num > 0) >- uroute_destroy(&list[--num]); >- FREE(TYPED_MEM_TEMP, list); >+ rtn = 0; >+done2: >+ FREE(TYPED_MEM_TEMP, buf); >+done: >+ (void)close(sock); > errno = errno_save; > return (rtn); > } >--- http/servlet/http_servlet_cookieauth.c.orig Sat Jan 22 06:01:58 2005 >+++ http/servlet/http_servlet_cookieauth.c Sun Sep 17 19:53:55 2006 >@@ -54,6 +54,7 @@ > #include <pthread.h> > > #include <openssl/ssl.h> >+#include <openssl/md5.h> > > #include "structs/structs.h" > #include "structs/type/array.h" >--- ppp/ppp_l2tp_ctrl.c 2005-01-21 23:02:07.000000000 +0200 >+++ ppp/ppp_l2tp_ctrl.c 2009-06-23 15:45:43.000000000 +0300 >@@ -200,7 +200,7 @@ struct ppp_l2tp_sess { > u_int16_t peer_id; /* peer session id */ > struct ppp_log *log; /* log */ > ng_ID_t node_id; /* tee node id */ >- char hook[NG_HOOKLEN + 1]; /* session hook name */ >+ char hook[NG_HOOKSIZ]; /* session hook name */ > void *link_cookie; /* opaque link cookie */ > u_int16_t result; /* close result code */ > u_int16_t error; /* close error code */ >@@ -608,7 +608,7 @@ ppp_l2tp_ctrl_create(struct pevent_ctx * > > /* Done */ > *nodep = ctrl->node_id; >- strlcpy(hook, NG_L2TP_HOOK_LOWER, NG_HOOKLEN + 1); >+ strlcpy(hook, NG_L2TP_HOOK_LOWER, NG_HOOKSIZ); > return (ctrl); > > fail: >@@ -1860,7 +1860,7 @@ ppp_l2tp_ctrl_event(void *arg) > struct ng_mesg msg; > } buf; > struct ng_mesg *const msg = &buf.msg; >- char raddr[NG_PATHLEN + 1]; >+ char raddr[NG_PATHSIZ]; > int len; > > /* Read netgraph control message */ >--- ppp/ppp_l2tp_ctrl.h 2005-01-21 23:02:07.000000000 +0200 >+++ ppp/ppp_l2tp_ctrl.h 2009-06-23 15:45:22.000000000 +0300 >@@ -201,7 +201,7 @@ __BEGIN_DECLS > * peer_id Unique identifier for peer (used for tie-breakers) > * initiate Whether to send a SCCRQ or just wait for one > * nodep Pointer to netgraph node ID variable >- * hook Buffer for hook on L2TP netgraph node (size >= NG_HOOKLEN + 1) >+ * hook Buffer for hook on L2TP netgraph node (size >= NG_HOOKSIZ) > * avps List of AVP's to include in the associated > * Start-Control-Connection-Request or > * Start-Control-Connection-Reply control message. >--- ppp/ppp_l2tp_server.c 2005-01-21 23:02:07.000000000 +0200 >+++ ppp/ppp_l2tp_server.c 2009-06-23 15:45:33.000000000 +0300 >@@ -103,7 +103,7 @@ struct ppp_l2tp_peer { > struct ppp_channel *chan; /* pointer to channel */ > struct ppp_auth_config auth; /* auth config */ > char node[32]; /* node path */ >- char hook[NG_HOOKLEN + 1]; /* node hook */ >+ char hook[NG_HOOKSIZ]; /* node hook */ > char logname[32]; /* peer logname */ > struct in_addr ip; /* peer ip address */ > u_int16_t port; /* peer port */ >@@ -536,7 +536,7 @@ ppp_l2tp_server_sock_event(void *arg) > struct sockaddr_in sin; > const size_t bufsize = 8192; > u_int16_t *buf = NULL; >- char hook[NG_HOOKLEN + 1]; >+ char hook[NG_HOOKSIZ]; > socklen_t sin_len; > char namebuf[64]; > ng_ID_t node_id; >--- ppp/ppp_node.c 2005-01-21 23:02:08.000000000 +0200 >+++ ppp/ppp_node.c 2009-06-23 15:45:52.000000000 +0300 >@@ -431,7 +431,7 @@ int > ppp_node_send_msg(struct ppp_node *node, const char *relpath, > u_int32_t cookie, u_int32_t cmd, const void *payload, size_t plen) > { >- char path[NG_PATHLEN + 1]; >+ char path[NG_PATHSIZ]; > > if (relpath == NULL) > strlcpy(path, NODE_HOOK, sizeof(path)); >@@ -494,7 +494,7 @@ ppp_node_read_message(void *arg) > { > struct ppp_node *const node = arg; > const size_t max_msglen = 4096; >- char raddr[NG_PATHLEN + 1]; >+ char raddr[NG_PATHSIZ]; > struct ppp_node_recvmsg *rm; > struct ng_mesg *msg; > int found = 0; >--- ppp/ppp_auth_radius.c.orig Sat Jan 22 06:02:04 2005 >+++ ppp/ppp_auth_radius.c Sun Sep 17 19:55:28 2006 >@@ -44,6 +44,8 @@ > #include "ppp/ppp_auth.h" > #include "ppp/ppp_msoft.h" > >+#include <openssl/md5.h> >+ > #include <poll.h> > #include <radlib.h> > #include <radlib_vs.h> >--- ppp/ppp_auth_radius.c.orig Sun Apr 1 23:13:10 2007 >+++ ppp/ppp_auth_radius.c Sun Apr 1 23:16:01 2007 >@@ -462,7 +462,7 @@ > > /* Compensate for broken servers that leave out the ID byte */ > if (len > 0 && (len < 3 || ((const char *)data)[1] != '=')) { >- ((const char *)data)++; >+ data = (const char *)data + 1; > len--; > } > >--- util/rsa_util.c.orig Sat Jan 22 06:02:19 2005 >+++ util/rsa_util.c Sun Sep 17 19:58:23 2006 >@@ -50,6 +50,7 @@ > > #include <openssl/ssl.h> > #include <openssl/err.h> >+#include <openssl/md5.h> > > #include "structs/structs.h" > #include "structs/type/array.h" >--- util/paction.c (revision 68) >+++ util/paction.c (working copy) >@@ -39,7 +39,7 @@ > #endif > paction_finish_t *finish; /* action finisher */ > void *arg; /* action argument */ >- u_char started; /* action thread started */ >+ u_char may_cancel; /* ok to cancel action thread */ > u_char canceled; /* action was canceled */ > }; > >@@ -118,10 +118,11 @@ > > /* > * Don't cancel the thread before paction_main() starts, because >- * then paction_cleanup() would never get invoked. Instead, use >- * the 'started' and 'canceled' flags to avoid this race condition. >+ * then paction_cleanup() would never get invoked. Also don't >+ * pthread_cancel() the thread after the handler has completed, >+ * because we might cancel in the middle of the cleanup. > */ >- if (action->started) >+ if (action->may_cancel) > pthread_cancel(action->tid); > > /* Unlock action */ >@@ -139,9 +140,9 @@ > /* Cleanup when thread exits */ > pthread_cleanup_push(paction_cleanup, action); > >- /* Mark thread as started */ >- assert(!action->started); >- action->started = 1; /* race condition ok */ >+ /* Begin allowing pthread_cancel()'s */ >+ assert(!action->may_cancel); >+ action->may_cancel = 1; > > /* Handle race between paction_cancel() and paction_main() */ > if (action->canceled) /* race condition ok */ >@@ -151,6 +152,14 @@ > (*action->handler)(action->arg); > > done:; >+ /* Stop allowing pthread_cancel()'s */ >+ MUTEX_LOCK(&action->mutex, action->mutex_count); >+ action->may_cancel = 0; >+ MUTEX_UNLOCK(&action->mutex, action->mutex_count); >+ >+ /* Consume any last-minute pthread_cancel() still pending */ >+ pthread_testcancel(); >+ > /* Done */ > pthread_cleanup_pop(1); > return (NULL); >--- util/pevent.c.orig 2005-01-21 23:02:19.000000000 +0200 >+++ util/pevent.c 2007-11-11 16:06:04.000000000 +0200 >@@ -155,6 +155,15 @@ > _pevent_unref(ev); \ > } while (0) > >+#define PEVENT_SET_OCCURRED(ctx, ev) \ >+ do { \ >+ (ev)->flags |= PEVENT_OCCURRED; \ >+ if ((ev) != TAILQ_FIRST(&ctx->events)) { \ >+ TAILQ_REMOVE(&(ctx)->events, (ev), next); \ >+ TAILQ_INSERT_HEAD(&(ctx)->events, (ev), next); \ >+ } \ >+ } while (0) >+ > /* Internal functions */ > static void pevent_ctx_service(struct pevent *ev); > static void *pevent_ctx_main(void *arg); >@@ -338,7 +347,11 @@ > ev->u.millis = 0; > gettimeofday(&ev->when, NULL); > ev->when.tv_sec += ev->u.millis / 1000; >- ev->when.tv_usec += ev->u.millis % 1000; >+ ev->when.tv_usec += (ev->u.millis % 1000) * 1000; >+ if (ev->when.tv_usec > 1000000) { >+ ev->when.tv_sec++; >+ ev->when.tv_usec -= 1000000; >+ } > break; > case PEVENT_MESG_PORT: > va_start(args, type); >@@ -394,15 +407,16 @@ > } else > pevent_ctx_notify(ctx); > >+ /* Caller gets the one reference */ >+ ev->peventp = peventp; >+ *peventp = ev; >+ > /* Add event to the pending event list */ > PEVENT_ENQUEUE(ctx, ev); > > /* Unlock context */ > MUTEX_UNLOCK(&ctx->mutex, ctx->mutex_count); > >- /* Done; caller gets the one reference */ >- ev->peventp = peventp; >- *peventp = ev; > return (0); > } > >@@ -469,7 +483,7 @@ > goto done; > > /* Mark event as having occurred */ >- ev->flags |= PEVENT_OCCURRED; >+ PEVENT_SET_OCCURRED(ctx, ev); > > /* Wake up thread if event is still in the queue */ > if ((ev->flags & PEVENT_ENQUEUED) != 0) >@@ -523,6 +537,7 @@ > struct timeval now; > struct pollfd *fd; > struct pevent *ev; >+ struct pevent *next_ev; > int poll_idx; > int timeout; > int r; >@@ -562,6 +577,13 @@ > } > } > >+ /* If we were intentionally woken up, read the wakeup byte */ >+ if (ctx->notified) { >+ DBG(PEVENT, "ctx %p thread was notified", ctx); >+ (void)read(ctx->pipe[0], &pevent_byte, 1); >+ ctx->notified = 0; >+ } >+ > /* Add event for the notify pipe */ > poll_idx = 0; > if (ctx->fds_alloc > 0) { >@@ -620,7 +642,7 @@ > switch (ev->type) { > case PEVENT_MESG_PORT: > if (mesg_port_qlen(ev->u.port) > 0) >- ev->flags |= PEVENT_OCCURRED; >+ PEVENT_SET_OCCURRED(ctx, ev); > break; > default: > break; >@@ -654,7 +676,8 @@ > gettimeofday(&now, NULL); > > /* Mark poll() events that have occurred */ >- TAILQ_FOREACH(ev, &ctx->events, next) { >+ for (ev = TAILQ_FIRST((&ctx->events)); ev != NULL; ev = next_ev) { >+ next_ev = TAILQ_NEXT(ev, next); > assert(ev->magic == PEVENT_MAGIC); > switch (ev->type) { > case PEVENT_READ: >@@ -664,33 +687,23 @@ > fd = &ctx->fds[ev->poll_idx]; > if ((fd->revents & ((ev->type == PEVENT_READ) ? > READABLE_EVENTS : WRITABLE_EVENTS)) != 0) >- ev->flags |= PEVENT_OCCURRED; >+ PEVENT_SET_OCCURRED(ctx, ev); > break; > case PEVENT_TIME: > if (timercmp(&ev->when, &now, <=)) >- ev->flags |= PEVENT_OCCURRED; >+ PEVENT_SET_OCCURRED(ctx, ev); > break; > default: > break; > } > } > >- /* If we were intentionally woken up, read the wakeup byte */ >- if (ctx->notified) { >- DBG(PEVENT, "ctx %p thread was notified", ctx); >- (void)read(ctx->pipe[0], &pevent_byte, 1); >- ctx->notified = 0; >- } >- > /* Service all events that are marked as having occurred */ > while (1) { > >- /* Find next event that needs service XXX this is O(n^2) XXX */ >- TAILQ_FOREACH(ev, &ctx->events, next) { >- if ((ev->flags & PEVENT_OCCURRED) != 0) >- break; >- } >- if (ev == NULL) >+ /* Find next event that needs service */ >+ ev = TAILQ_FIRST(&ctx->events); >+ if (ev == NULL || (ev->flags & PEVENT_OCCURRED) == 0) > break; > DBG(PEVENT, "ctx %p thread servicing ev %p", ctx, ev); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 275112
:
195516
|
265809
| 265811 |
265813
|
265815
|
268421
|
268423
|
268425