Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 311416 Details for
Bug 454703
netdump uses hard-coded remote port for server
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
use the client's local port when replying
netdump-clientport.patch (text/plain), 4.30 KB, created by
Bryn M. Reeves
on 2008-07-09 20:18:52 UTC
(
hide
)
Description:
use the client's local port when replying
Filename:
MIME Type:
Creator:
Bryn M. Reeves
Created:
2008-07-09 20:18:52 UTC
Size:
4.30 KB
patch
obsolete
>diff -up netdump-0.7.16/netdumpclient.c.clientport netdump-0.7.16/netdumpclient.c >--- netdump-0.7.16/netdumpclient.c.clientport 2008-07-09 13:47:03.000000000 +0100 >+++ netdump-0.7.16/netdumpclient.c 2008-07-09 13:56:29.000000000 +0100 >@@ -110,6 +110,7 @@ clear_do_print(void) > > typedef struct { > guint32 ip; >+ guint16 port; > int count; > unsigned char magic_value[MAGIC_SIZE]; > } RebootRequest; >@@ -133,7 +134,7 @@ netdump_client_send_reboot (gpointer dat > > memset (&addr, 0, sizeof (addr)); > addr.sin_family = AF_INET; >- addr.sin_port = htons(NETDUMP_PORT); >+ addr.sin_port = htons(reboot->port); > addr.sin_addr.s_addr = htonl(reboot->ip); > > memset (&req, 0, sizeof(req)); >@@ -175,6 +176,7 @@ netdump_client_reboot (NetdumpClient *cl > reboot = g_new0 (RebootRequest, 1); > > reboot->ip = client->ip; >+ reboot->port = client->port; > memcpy (reboot->magic_value, client->magic_value, MAGIC_SIZE); > reboot->count = 0; > >@@ -353,7 +355,7 @@ netdump_client_send_request (NetdumpClie > > memset (&addr, 0, sizeof (addr)); > addr.sin_family = AF_INET; >- addr.sin_port = htons(NETDUMP_PORT); >+ addr.sin_port = htons(client->port); > addr.sin_addr.s_addr = htonl(client->ip); > > memset (&req, 0, sizeof(req)); >@@ -390,6 +392,7 @@ netdump_client_send_request (NetdumpClie > > NetdumpClient * > netdump_client_new (guint32 ip, >+ guint16 port, > const char *dir, > const char magic[MAGIC_SIZE], > gboolean just_reboot, >@@ -404,15 +407,17 @@ netdump_client_new (guint32 ip, > client = g_new0 (NetdumpClient, 1); > > #ifdef DEBUG >- g_print (" netdump_client_new() ip: %d.%d.%d.%d -> %p\n", >+ g_print (" netdump_client_new() ip: %d.%d.%d.%d:%d -> %p\n", > (ip >> 24) & 0xff, > (ip >> 16) & 0xff, > (ip >> 8) & 0xff, > (ip) & 0xff, >+ port, > client); > #endif > > client->ip = ip; >+ client->port = port; > sprintf((char *)client->ip_addr, "%d.%d.%d.%d", > (ip >> 24) & 0xff, > (ip >> 16) & 0xff, >diff -up netdump-0.7.16/netdumpclient.h.clientport netdump-0.7.16/netdumpclient.h >--- netdump-0.7.16/netdumpclient.h.clientport 2008-07-09 13:47:03.000000000 +0100 >+++ netdump-0.7.16/netdumpclient.h 2008-07-09 13:47:09.000000000 +0100 >@@ -24,6 +24,7 @@ typedef struct { > > struct _NetdumpClient { > guint32 ip; >+ guint16 port; > gboolean just_reboot; > > guint32 outstanding_request; >@@ -84,6 +85,7 @@ struct _NetdumpClient { > > > NetdumpClient *netdump_client_new (guint32 ip, >+ guint16 port, > const char *dir, > const char magic[MAGIC_SIZE], > gboolean just_reboot, >diff -up netdump-0.7.16/netdumpclient.o.clientport netdump-0.7.16/netdumpclient.o >Binary files netdump-0.7.16/netdumpclient.o.clientport and netdump-0.7.16/netdumpclient.o differ >diff -up netdump-0.7.16/server.c.clientport netdump-0.7.16/server.c >--- netdump-0.7.16/server.c.clientport 2008-07-09 13:47:04.000000000 +0100 >+++ netdump-0.7.16/server.c 2008-07-09 13:47:09.000000000 +0100 >@@ -202,7 +202,7 @@ load_magic (guint32 ip, guchar magic[MAG > > > static void >-handle_new_client (guint32 ip, guchar *magic, reply_t *reply, char *msg) >+handle_new_client (guint32 ip, guint16 port, guchar *magic, reply_t *reply, char *msg) > { > NetdumpClient *client; > const char *dir; >@@ -231,7 +231,7 @@ handle_new_client (guint32 ip, guchar *m > just_reboot = TRUE; > } > >- client = netdump_client_new (ip, dir, (char *)magic, just_reboot, reply, msg); >+ client = netdump_client_new (ip, port, dir, (char *)magic, just_reboot, reply, msg); > g_hash_table_insert (clients, client, client); > } > } >@@ -287,6 +287,7 @@ master_socket_packet (GIOChannel *chann > int len; > struct sockaddr_in addr; > int addr_len = sizeof(addr); >+ guint16 port; > > int fd = g_io_channel_unix_get_fd (channel); > >@@ -299,6 +300,7 @@ master_socket_packet (GIOChannel *chann > } > > key.ip = ntohl (addr.sin_addr.s_addr); >+ port = ntohs (addr.sin_port); > #if 0 > g_print ("got packet from %d.%d.%d.%d\n", > (key.ip >> 24) & 0xff, >@@ -341,7 +343,7 @@ master_socket_packet (GIOChannel *chann > > if (ntohl (reply.code) == REPLY_START_NETDUMP) > { >- handle_new_client (key.ip, magic, &reply, (char *)&buf[HEADER_LEN]); >+ handle_new_client (key.ip, port, magic, &reply, (char *)&buf[HEADER_LEN]); > } > else if (ntohl (reply.code) == REPLY_LOG) > {
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 454703
: 311416