Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

if conn timeout,we want to call conversation_remove_from_hashtable and free conn,how did i do? #50

Closed
wants to merge 429 commits into from

Conversation

ygm521
Copy link

@ygm521 ygm521 commented Aug 27, 2021

also did not free any mem.

void
conn_timeout_deal()
{
conversation_t *conn_node = NULL;
struct list_head *pos = NULL, n = NULL;
wmem_map_t
hashtable;

if (list_empty(&conn_head_list)) {
	return;
}

struct timeval now;
gettimeofday(&now, NULL);

list_for_each_safe(pos, n, &conn_head_list) {
	conn_node = list_entry(pos, conversation_t, list);
	
	if((now.tv_sec - conn_node->conn_time.tv_sec) < 30) {
	   break;
	}

	if (conn_node->options & NO_ADDR2) {
		if (conn_node->options & (NO_PORT2|NO_PORT2_FORCE)) {
			hashtable = conversation_hashtable_no_addr2_or_port2;
		} else {
			hashtable = conversation_hashtable_no_addr2;
		}
	} else {
		if (conn_node->options & (NO_PORT2|NO_PORT2_FORCE)) {
			hashtable = conversation_hashtable_no_port2;
		} else {
			hashtable = conversation_hashtable_exact;
		}
	}

	conversation_remove_from_hashtable(hashtable, conn_node);
	list_del(pos);

	if (conn_node->key_ptr) {           
		wmem_free(wmem_file_scope(), conn_node->key_ptr);
	}

	if(conn_node->dissector_tree && !wmem_tree_is_empty(conn_node->dissector_tree)) {
		wmem_tree_destroy(conn_node->dissector_tree, FALSE, FALSE);
	}

	wmem_free(wmem_file_scope(), conn_node);
	conn_node = NULL;
}

}

orgads and others added 30 commits January 3, 2021 08:03
(partially cherry picked from commit
eef4ba7)
Update manuf, services enterprise numbers, translations, and other items.
+ Simplify length checks

(cherry picked from commit 4003a5f)
In OverlayScrollBar return the real ScrollBar sliderPosition to ensure
the correct value is used when handling the actionTriggered signal in
vScrollBarActionTriggered().

This improves turning on and off auto scroll during capture when page
stepping using the packet list slider, because the value is propagated
after this signal.


(cherry picked from commit 7980f25)
Apple Silicon requires CMake 3.19.2, but the binaries provided
for 3.19.2 only run on MacOS 10.10 and later, so we have more
bifurcation of the CMake we try to install. Get rid of some of
the old 2.x paths to compensate.


(cherry picked from commit d74bfc5)
The HW version is correctly parsed as 2 bytes but shown as 3 bytes in
the dissection. This is fixed here.

Fixes #17133


(cherry picked from commit 1546a0a)
Update manuf, services enterprise numbers, translations, and other items.
Set the parent of the QMessageBox in the constructor instead of calling
QMessageBox::setParent(). The latter inherits from QDialog, and it
"clear[s] the window flags specifying the window-system properties for
the widget (in particular it will reset the Qt::Dialog flag)."
(See https://doc.qt.io/qt-5/qdialog.html#details )
This makes the dialog properly appear instead of attempting to save a file
with comments to a file type that does not support comments silently failing.
Fixes #17146.


(cherry picked from commit fb422be)
contact-params are optional (s. https://tools.ietf.org/html/rfc3261#section-20.10).
Therefore, independently of contact-params, we should also check for additional contact-param.

Fixes: wireshark/wireshark#13752


(cherry picked from commit 02f2d18)
Adding ISO13400-2019 DoIP Version 3.


(cherry picked from commit 69710ff)
This patch fixes the PNI TFString, which was wrong. Correct is:
0 = "... contains no Partial Network ..."
1 = "... contains Partial Network ..."

Fixes #17154


(cherry picked from commit 238446d)
Update manuf, services enterprise numbers, translations, and other items.
When unable to decrypt SH packets we should visualize an error, via
expert info. This way we handle SH and LH errors in the same way.

Close #17077


(cherry picked from commit 9faf6d4)
Fix various warnings with the following changes:

Pass a list of include directories to lupdate. Fixes:

    ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree

and similar warnings.

Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes:

    ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context
    ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data

Add Q_OBJECT to the class definition. Fixes:

    ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro

The following warnings were not fixed. This might require moving IOGraph
to its own file:

    ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog


(cherry picked from commit 85a7938)
If, for example, you run out of file descriptors, dup() can fail, and
ws_dup() is a wrapper around it on UN*X.  Don't just pass the result of
ws_dup() to ws_fdopen(); instead, save its result, check against -1 and,
if it's -1, give up, otherwise pass it to ws_fdopen().

This addresses Coverity CID 1471708.

Also, if ws_fdopen() fails, close the descriptor we got from ws_dup();
this closes a possible FD leak.


(cherry picked from commit 165792f)
For

	A & B ? C : D

put "A & B" in parentheses, to clarify the precedence.


(cherry picked from commit 6b85987)
For

        A & B ? C : D

put "A & B" in parentheses, to clarify the precedence.


(cherry picked from commit 138041b)
In dump_dfilter_macro_t(), if the dfilter_macro_t pointer is null, just
give up after printing the message that indicates that.

This should squelch several nullPointerRedundantCheck warnings from
cppcheck.


(cherry picked from commit 05b9e53)
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.


(cherry picked from commit b794e47)
Do not use FT_IPV6 as an interface identifier could be wrongly identified
as an IPv4-Compatible IPv6 Address format by inet_ntop() and displayed
as such.

(cherry picked from commit f64eddf)

Conflicts:
	epan/dissectors/packet-nas_5gs.c
This corrects 2 issues with the detection heuristic for f5ethtrailers
causing trailers to be missed.

Fixes #17171
Fixes #17172

(cherry picked from commit b297afe)
extcap_register_preferences is only called with the -G option
(to dump information) and extcap preferences are not loading,
loading it unconditionally avoids this, as it is done in the
GUI startup.


(cherry picked from commit 506f1c6)
Update manuf, services enterprise numbers, translations, and other items.
geraldcombs and others added 27 commits July 11, 2021 09:53
Update manuf, services enterprise numbers, translations, and other items.
[skip ci]
Currently there can be multiple dlm messages in one tcp segment and in
some cases dlm message can be overlapped between two segments. The main
fix would be that we can now dissect multiple dlm messages if they
appear in one tcp segment. It's still own as one message in the "packet
flow" but in tree view it will be displayed as multiple messages which
are not visible.

For sctp the problem still exists, although there can't be overlapped messages.


(cherry picked from commit 456c74c)
Update manuf, services enterprise numbers, translations, and other items.
Update manuf, services enterprise numbers, translations, and other items.
For better or worse, currently, if you have a field that is broken into
bitfields, the top-level field must be integral, so the entire field's
value is shown.  A case could be made that FT_NONE should be supported,
but that's not the case now.

Fixes issue #17505.


(cherry picked from commit 436a9fa)
Closes #17509

(cherry picked from commit afb1aff)
Update manuf, services enterprise numbers, translations, and other items.
Starting from libilbc 3.0.0 the type iLBC_decinst_t has been marked
deprecated.
Other fixes rely on function prototype requiring uint8_t pointer.

Part 1/2 to make CI pipelines happy.

(cherry picked from commit 93f6aa2)
Not all shells support [[ ]] compound commands; it's not in the most
recent Single UNIX Specification I could see, and the
ubuntu-clang-other-tests job is reporting

    tools/validate-clang-check.sh: 18: [[: not found

Don't use [[ ]].

In addition, if you change extcap/etl.c, it tries to run clang-check on
it, but that file builds, and is only built, on Windows, so clang-check
fails dismally on UN*Xes.  Omit it for now.


(cherry picked from commit 0d12050)
Starting from libilbc 3.0.0 the type iLBC_decinst_t has been marked
deprecated.
Other fixes rely on function prototype requiring uint8_t pointer.

Part 2/2 to make CI pipelines happy.

(cherry picked from commit 93f6aa2)
Fix a number of instances where the captype man page refers to
capinfos instead of captype. (Copy and paste-o.) Also add captype
to the SEE ALSO section of the capinfos man page.


(cherry picked from commit 611013f)
Update manuf, services enterprise numbers, translations, and other items.
Don't just change the linktype of the file (if it has one) and the
linktypes of all the packets, change the linktype of all interfaces as
well.

Fixes #17520.

(backported from commit 158810c)
The editcap documentation still refers to the pre 1.2.1 behavior
of determining output file names when splitting based on either
packet counts or time intervals. (See commit a8eb860) Update
it to reflect the current behavior.


(cherry picked from commit 3c5168c)
Fix clock accuracy field offset in the sync info information in the
extended advertising header.
The field was placed at offset 4 instead of the current offset + 4.

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Update manuf, services enterprise numbers, translations, and other items.
Only use value of Content-Format to dissect the content in the
current packet. Accept is used to tell which format is expected
in the reply.

Fixes: #17536


(cherry picked from commit 1807d38)
Show value from status word in info column when packet is a
response only (not SIMtrace).


(cherry picked from commit ebf5da6)
Update manuf, services enterprise numbers, translations, and other items.
[skip ci]
Conflicts:
	.gitlab-ci.yml
@repo-lockdown
Copy link

repo-lockdown bot commented Aug 27, 2021

Hi, thank you for your contribution!

GitHub is however not the right place for these, please have a look at
https://www.wireshark.org/docs/wsdg_html_chunked/ChSrcContribute.html
for further instructions.

@repo-lockdown repo-lockdown bot closed this Aug 27, 2021
@repo-lockdown repo-lockdown bot locked and limited conversation to collaborators Aug 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet