aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2018-04-07 12:56:45 +0200
committerStig Bjørlykke <stig@bjorlykke.org>2018-04-07 18:02:23 +0000
commit5d1b5648fa900319fc4d212f2fd78562959716ba (patch)
treee4898cc51044dde3fd3b3254e5449e752c1e6184 /extcap.c
parent1839a43f2593f0075db92f134e80e59e163cb5db (diff)
extcap: Always use byte mode in pipes
The original PipeMode parameter to CreateNamedPipe() was wrong but when running gave a correct value. The changes in g00373a1f tried to fix this parameter but this gave incorrect values. Bug: 14532 Change-Id: Ia1e8e9ba54abfcc3bd0856fd715b7c69ee54ccfe Reviewed-on: https://code.wireshark.org/review/26786 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Reviewed-by: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
Diffstat (limited to 'extcap.c')
-rw-r--r--extcap.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/extcap.c b/extcap.c
index 51640f8cca..a0d9d319bf 100644
--- a/extcap.c
+++ b/extcap.c
@@ -1410,12 +1410,12 @@ extcap_init_interfaces(capture_options *capture_opts)
if (extcap_has_toolbar(interface_opts->name))
{
extcap_create_pipe(interface_opts->name, &interface_opts->extcap_control_in,
- EXTCAP_CONTROL_IN_PREFIX, FALSE);
+ EXTCAP_CONTROL_IN_PREFIX);
#ifdef _WIN32
interface_opts->extcap_control_in_h = pipe_h;
#endif
extcap_create_pipe(interface_opts->name, &interface_opts->extcap_control_out,
- EXTCAP_CONTROL_OUT_PREFIX, FALSE);
+ EXTCAP_CONTROL_OUT_PREFIX);
#ifdef _WIN32
interface_opts->extcap_control_out_h = pipe_h;
#endif
@@ -1423,7 +1423,7 @@ extcap_init_interfaces(capture_options *capture_opts)
/* create pipe for fifo */
if (!extcap_create_pipe(interface_opts->name, &interface_opts->extcap_fifo,
- EXTCAP_PIPE_PREFIX, TRUE))
+ EXTCAP_PIPE_PREFIX))
{
return FALSE;
}
@@ -1485,7 +1485,7 @@ extcap_init_interfaces(capture_options *capture_opts)
}
#ifdef _WIN32
-gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe_prefix, gboolean byte_mode)
+gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe_prefix)
{
gchar timestr[ 14 + 1 ];
time_t current_time;
@@ -1511,8 +1511,7 @@ gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe
pipe_h = CreateNamedPipe(
utf_8to16(pipename),
PIPE_ACCESS_DUPLEX | FILE_FLAG_OVERLAPPED,
- (byte_mode ? (PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT) :
- (PIPE_TYPE_MESSAGE | PIPE_READMODE_MESSAGE | PIPE_WAIT)),
+ PIPE_TYPE_BYTE | PIPE_READMODE_BYTE | PIPE_WAIT,
1, 65536, 65536,
300,
&security);
@@ -1532,7 +1531,7 @@ gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe
return TRUE;
}
#else
-gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe_prefix, gboolean byte_mode _U_)
+gboolean extcap_create_pipe(const gchar *ifname, gchar **fifo, const gchar *pipe_prefix)
{
gchar *temp_name = NULL;
int fd = 0;